﻿/**
 * AbstractDeflector
 *
 * @author		Allen Chou
 * @version 	1.1.1 (last update: Aug 26 2008)
 * @link        http://cjcat.blogspot.com
 * @link		http://cjcat2266.deviantart.com
 */

/*
 * Copyright 2008 (C) Allen Chou (cjcat2266@gmail.com)
 *
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use,
 * copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following
 * conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 */

package idv.cjcat.display.particles {
	import idv.cjcat.*;
	
	public class AbstractDeflector {
		
		public var active:Boolean = true;
		protected var _damping:Number;
		
		//this is an abstract class and should not be instantiated.
		public function AbstractDeflector() {	}
		
		//this is an abstract function and should be overridden.
		//the vector object returned should have an vx and va y property.
		//in addition, this object returned can also have an newX and an newY property
		//for particle position adjustment.
		public function getVectorObj(x:Number, y:Number, vx:Number, vy:Number):Object { return new Object(); }
		
		public function get damping():Number { return _damping;	}
		public function set damping(value:Number):void {
			_damping = CJMath.clamp(value, 0, 1);
		}
		
	}
}